<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>数据本地存储</title>
  </head>
  <body>
    <script>
      //一个项目大部分呈现出来的数据都是通过调后端接口取到的
      //今天涉及到页面中的数据的存取 借助localStsorage
      var Datas = [
        { id: 10001, name: "索尼相机", price: 799, img: "./img/cream.jpg" },
        { id: 10002, name: "古风头钗", price: 520, img: "./img/gun.jpg" },
        { id: 10003, name: "达瓦鱼竿", price: 2799, img: "./img/dawa.jpg" },
      ];
      localStorage.setItem("Datas", JSON.stringify(Datas));
    </script>
  </body>
</html>
